#include <iostream>
using namespace std;
#include <memory>
using std::auto_ptr;

class Integer{
	public:
		Integer(int i = 0) : value (i)
		{
			cout << "Integer constrcutor is called:" << value << "\n";
		}
		~Integer()
		{
			cout << "Integer destructor is called:" << value << "\n";
		}
		int getInteger() const
		{
			return value;
		}
		void setInteger(int i)
		{
			value = i;
		}
	private:
		int value;
		
};

int main()
{
	int temp;
	Integer *integerNew = new Integer(10);
	integerNew->setInteger(100);
	cout << integerNew->getInteger() << "\n";
	cout << "&integerNew = " << &integerNew << "\n";
	delete integerNew;
	
	
	auto_ptr<Integer> ptrToInteger(new Integer(7));
	ptrToInteger->setInteger(99);
	cout << (*ptrToInteger).getInteger() << "\n";
	return 0;
}
